Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normalize Ligature Caret List #1227

Merged
merged 2 commits into from
Jan 31, 2025
Merged

Normalize Ligature Caret List #1227

merged 2 commits into from
Jan 31, 2025

Conversation

cmyr
Copy link
Member

@cmyr cmyr commented Jan 30, 2025

This table is a lot like mark/kern rules, in that it contains scalar values that can have variations applied. Like with those structures, this is an excellent case for normalization, since it means we can ignore differences related to the order in which deltas are stored.

This patch adds the ability to normalize this table, and updates ttx_diff to do that and to remove it as well as the VarStore from GDEF.

This gives us another +20 or so on crater.

The LigCaretList in GDEF is another subtable that contains values that
may have associated variation data, which means that it is highly
susceptable to minor differences related to the sort order of the
item variation store.

This adds logic for generating a normalized representation of this
tables contents, simililar to how we handle marks & kerns.
if table == "gpos":
out_path = font_file.with_suffix(".markkern.txt")
elif table == "gdef":
out_path = font_file.with_suffix(".norm_gdef.txt")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I like the idea of the normalizer outputs having a consistent naming pattern. Why do we call gpos markkern and gdef norm_gdef instead of something consistent?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd avoided this because I thought it would screw up the next crater run (since the old run would produce the first name, and the second would produce the new name, and they wouldn't know about each other) but this filename isn't actually the name that we use in crater so it should be fine, can change markkern to norm_gpos.

Copy link
Contributor

@rsheeter rsheeter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+20 ftw!

And delete this subtable as well as the ItemVariationStore from the GDEF
table.

We now normalize everything that otherwise depended on the GDEF
VarStore, so we can ignore it during diffing.
@cmyr cmyr force-pushed the normalize-lig-carets branch from 68bcbb2 to 10911df Compare January 30, 2025 23:11
@cmyr cmyr added this pull request to the merge queue Jan 31, 2025
Merged via the queue into main with commit 30a658b Jan 31, 2025
10 checks passed
@cmyr cmyr deleted the normalize-lig-carets branch January 31, 2025 00:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants